-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORE-15552 Add findUnconsumedStatesByExactType
paging API
#1292
CORE-15552 Add findUnconsumedStatesByExactType
paging API
#1292
Conversation
Non-blocking downstream job failed for corda-e2e-test https://ci02.dev.r3.com/job/Corda5/job/corda-api-compatibility/job/PR-1292/1/ has failed for PR 1292 build 1 Please investigate if your changes may have broken compilation on https://github.com/corda/corda-e2e-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the PR needs a bit more background adding to the description, and a link to the runtime-os PR.
ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java
Outdated
Show resolved
Hide resolved
<T extends ContractState> ResultSet<StateAndRef<T>> findUnconsumedStatesByExactType( | ||
@NotNull Class<T> type, | ||
@NotNull Integer limit, | ||
@NotNull Instant createdTimestampLimit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly speaking, this is a change beyond what is claimed by this PR. If we want to add this, then the PR title / description should reflect this as well.
Do we actually have a use-case for this? If the intent is just to limit it to what exists at the start of the query, then this could just be done internally. Or we could actually just allow it to get the latest results until it runs out of results to return, and not set any limit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It keeps its functionality in line with the vault named query functionality. I think it makes sense to restrict it in the same way we do there, especially since the underlying mechanism is the same between them. We can do it internally if we wanted to, but either way it needs setting whether publicly or internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then the question is whether we want to force users to have to provide it, or we provide another overload / a default argument that just sets it to now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the fact users have to provide a timestamp on this API - there should at least be an override that defaults to now()
.
A question in regards to this PR. Should we remove the |
b95ce64
to
5bea12c
Compare
Jenkins build for PR 1292 build 7 Build Successful: |
That sounds reasonable if it's not been released yet. We can also ask the question whether we should support paging on |
Agreed, I think there is no point. In fact, I suggest we |
d76e927
to
1326493
Compare
4c83854
to
183ea31
Compare
183ea31
to
1815602
Compare
Add
findUnconsumedStatesByExactType
toUtxoLedgerService
, allowing developers to retrieve states by type from the vault in pages. This dissuades developers from retrieving every state from the vault in one go and returning them to a flow.